package com.atguigu.lease.common.context;

public class LoginUserContext {
    private static final ThreadLocal<LoginUser> threadLocal=new ThreadLocal<>();

    private LoginUserContext(){}

    public static void setLoginUser(LoginUser loginUser){
        threadLocal.set(loginUser);
    }

    public static LoginUser getLoginUser(){
        return threadLocal.get();
    }

    public static void clear(){
        threadLocal.remove();
    }
}
